package com.wz.controller;


import com.wz.common.bean.PageBean;
import com.wz.common.bean.ResultBean;
import com.wz.common.controller.BaseController;
import com.wz.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>Project: wz_api_shop - OrderController
 * <p>Powered by pisces On 2022-02-14 19:27:37
 * <P>Created by IntelliJ IDEA
 *
 * @author ww606851@163.com
 * @version 1.0
 * @description:
 * @since 8
 */

@RestController
public class OrderController extends BaseController {

    @Autowired
    OrderService orderService;

    @PostMapping("/order/save")
    public ResultBean saveOrder(@RequestBody Map map){
        int rs = orderService.save(map);
        return rs>0?success("保存成功！"):fail("保存失败！");
    }

    @PostMapping("/shoporder/list")
    public ResultBean shopOrderList(@RequestBody Map map){
        PageBean bean = orderService.query(map);
        return success("店铺订单列表",bean);
    }

}
